package com.samehope.ar.mapper;

import com.samehope.ar.entity.Device;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.samehope.ar.vo.DeviceVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 设备 Mapper 接口
 * </p>
 *
 * @author Zhang Luo
 * @since 2019-12-23
 */
public interface DeviceMapper extends BaseMapper<Device> {

    /**
     * 获取当前企业绑定的设备列表
     * @param companyId
     * @return
     */
    List<DeviceVO> findDevicesByCompany(Long companyId);

    /**
     * 根据企业和设备ID查询设备
     * @param companyId
     * @param deviceId
     * @return
     */
    Device findDeviceByCompanyAndDevice(@Param("companyId") Long companyId,
                                        @Param("deviceId") Long deviceId);
}
